<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生测试</title>
</head>
<script src="jquery-1.8.3.js"></script>
<script type="text/javascript">
        function yan() {
            let name = $("#name").val().length;
            let age = $("#age").val().length;
            let birthday = $("#birthday").val();
            if(name>6){
                alert("名字的长度太长了")
            }
            if(age>25){
                alert("年龄太大了")
            }
        }
</script>
<body>
    <form action="/yanzheng.do">
        <input type="text" name="sname" placeholder="名字" id="name"><br>
        <input type="text" name="age" placeholder="年龄" id="age"><br>
        <input type="text" name="birthday" placeholder="生日" id="birthday"><br>
        <input type="submit" onclick="return yan()">
    </form>
</body>
</html>